using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Data;
using Dimok.Exceptions;
using Dimok.Web.UI;
using AjaxMasterExtentions;


public partial class Admin_Admin :System.Web.UI.MasterPage {
	public ProfileCommon ProfileLocal { get { return Profile; } }
	private Profiler _profiler;
	public Profiler Profiler {
		get {
			if (_profiler != null) return _profiler;
			return _profiler = this.GetProfiler();
		}
	}
	protected int TopSaved { get { return Math.Max(0, Profiler.Page.Position.Y); } }
	protected int LeftSaved { get { return Math.Max(0, Profiler.Page.Position.X); } }
	protected int WidthSaved { get { return Math.Max(200, Profiler.Page.Size.Width); } }
	protected int HeightSaved { get { return Math.Max(200, Profiler.Page.Size.Height); } }
	protected void Page_Load(object sender, EventArgs e) {
		if (!ScriptManager.GetCurrent(Page).IsInAsyncPostBack) {
			JS.ScriptLocalID(this.Page, btnRefresh);
			JS.RegisterWS(Page, "/manager/admin/admin.asmx");
			string userName = System.Threading.Thread.CurrentPrincipal.Identity.Name;
			if (userName == "") userName = System.Security.Principal.WindowsIdentity.GetCurrent().Name + "";
			Page.ClientScript.RegisterClientScriptBlock(Page.GetType(), "UserName", "var UserName='" + userName + "';", true);
		}
		//Page.ClientScript.RegisterClientScriptInclude("/JS/Events.js", "/JS/Events.js");
		//Page.ClientScript.RegisterClientScriptInclude("/Admin/Admin.js","/Admin/Admin.js");
		//Page.ClientScript.RegisterClientScriptInclude("/Admin/Default.js","/Admin/Default.js");
		//Page.ClientScript.RegisterClientScriptInclude("Chat4Support", "http://web.chat4support.com/Weboperator/Operator/banner.aspx?sid=561&sTag=DIMOK&style=1&online=1&nFloat=2&nInvite=1&nMode=0");
		//Page.ClientScript.RegisterClientScriptInclude("WnosOnV4", "/whoson_onrefund.com.js");
		//WhosOn.Init(Page);
	}
	protected void AtlasSM_AsyncPostBackError(object sender, AsyncPostBackErrorEventArgs e) {
		ScriptManager sm = Find.ChildByType(this, typeof(ScriptManager)) as ScriptManager;
		if (!typeof(ASPException).IsInstanceOfType(e.Exception)) ASPException.Publish(e.Exception);
		sm.AsyncPostBackErrorMessage = SmartException.GetMessages(e.Exception);
	}

}
